#!/usr/bin/python
# -*- coding: UTF-8 -*-

""" 
@version: 1.0
@author: jin.li.o
@license: Apache Licence 
@contact: x.leevin@gmail.com
@software: PyCharm
@file: iter.py
@time: 2018/9/26
"""

import sys

# 迭代器
# 迭代器的遍历可使用for, while

listZ = [1, 0.9, ["you", 2], "four"]

listIter = iter(listZ)

# 使用for遍历
print("使用for进行遍历:")
for item in listIter:
    print(next(listIter))

# 使用while遍历
# print("使用while进行遍历:")
# while True:
#     try:
#         print(next(listIter))
#     except StopIteration:
#         sys.exit()

print("path".format(sys.path))
